package srm;


import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;

public class ColorfulTilesEasy {

    public int theMin(String room) {
        int change = 0;
        int[] arr = { 0, 0, 
                      1, 1, 
                      2, 2,
                      3, 3,
                      4, 4,
                      5
        };

        int sublen = 1;
        for (int i = 1; i < room.length(); i++) {
            if (room.charAt(i) == room.charAt(i - 1))
            {
                sublen++;
            }
            else
            {
                change += arr[sublen];
                sublen = 1;
            }
        }
        
        change += arr[sublen];

        return change;
    }

    public static void main(String[] args)
    {
        ColorfulTilesEasy cte = new ColorfulTilesEasy();
        
        System.out.println(cte.theMin("BBBYYYYYY"));
    }
}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!
